<template>
  <aside class="btn-box">
    <el-row :gutter="10">
      <!-- <el-col :span="3">
        <el-button type="primary" size="mini" icon="el-icon-circle-plus-outline" @click="outgoingNoWarehousing">未入库发货</el-button>
        <outgoing-no-warehousing ref="noWarehousing" />
      </el-col>
      <el-col :span="3">
        <el-button type="primary" size="mini" icon="el-icon-circle-plus-outline" @click="outGoingOnline">已入库发货</el-button>
        <outgoing-online ref="outgoingOnline" />
      </el-col> -->
      <!-- <el-col :span="2">
        <el-button type="primary" size="mini" icon="el-icon-delete" @click="delFun">删除</el-button>
      </el-col> -->
      <el-col :span="2">
        <el-button type="primary" size="mini" icon="el-icon-search" @click="handleSearch">查找</el-button>
        <search-comp ref="searchPage" @search="search" />
      </el-col>
      <!-- <el-col :span="2.5">
        <el-button type="primary" size="mini" icon="el-icon-check" @click=" confirmIn">确认货号</el-button>
      </el-col>
      <el-col :span="3">
        <el-button type="primary" size="mini" icon="el-icon-download">下载物流码</el-button>
      </el-col>
      <el-col :span="3">
        <el-button type="primary" size="mini" icon="el-icon-location-outline">条码归属现状</el-button>
      </el-col>
      <el-col :span="2.5">
        <el-button type="primary" size="mini" icon="el-icon-upload2">上传结果</el-button>
      </el-col> -->
    </el-row>
  </aside>
</template>

<script>
import searchComp from './outgoing-search'
// import outgoingOnline from './outgoing-online'
// import outgoingNoWarehousing from './outgoing-no-warehousing'
export default {
  components: {
    searchComp
    // outgoingOnline,
    // outgoingNoWarehousing
  },
  props: {
    selectArr: {
      type: Array,
      default() {
        return []
      }
    }
  },
  methods: {
    delFun() {
      if (!this.selectArr.length) {
        this.$message.info('请先选择要删除的数据！')
      } else {
        let msg = ''
        for (const i in this.selectArr) {
          msg += ' ' + this.selectArr[i].id + ' '
        }
        this.$confirm('是否确认删除单号为' + msg + '的出库记录？', '提示', {
          confirmButtonText: '确认',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          console.log('删除')
        }).catch(() => {
          console.log('取消')
        })
      }
    },
    confirmIn() {
      if (!this.selectArr.length) {
        this.$message.info('请先选择需要确认的数据！')
      } else {
        let msg = ''
        for (const i in this.selectArr) {
          msg += ' ' + this.selectArr[i].id + ' '
        }
        this.$confirm('是否要将单号为' + msg + '的入库记录确认出货？', '提示', {
          confirmButtonText: '确认',
          cancelButtonText: '取消',
          type: 'success'
        }).then(() => {
          console.log('确认')
        }).catch(() => {
          console.log('取消')
        })
      }
    },
    outGoingOnline() {
      this.$refs.outgoingOnline.dialogFormVisible = true
    },
    outgoingNoWarehousing() {
      this.$refs.noWarehousing.dialogFormVisible = true
    },
    handleSearch() {
      this.$refs.searchPage.dialogFormVisible = true
    },
    search(val) {
      this.$emit('search', val)
    }
  }
}
</script>

<style lang="scss" scoped>
  .el-button {
        width: 100%;
    }
</style>
